var id=1;
function agregar()
{
    contenido="<div id='file"+id+"'>"+
          "<input type='file' name='file"+id+"'/>"+
          "<input type='button' value='X' onclick='eliminar(\"file"+id+"\")' /> <br /></div>";
    id=id+1;
    document.getElementById("lista").innerHTML+=contenido;
}

function agregarExterno()
{
    contenido="<div id='externo"+id+"'>"+
          "<input type='text' name='externo"+id+"'/>"+
          "<input type='button' value='X' onclick='eliminar(\"externo"+id+"\")' /> <br /></div>";
    id=id+1;
    document.getElementById("externo").innerHTML+=contenido;
}
function eliminar(capa)
{
    document.getElementById(capa).innerHTML="";
}
